package LABS.lab5;

/**************************************************************
* Class ManipulateQueueDemo
* @author Jeff Thomas - Thomas007
* @vesion 1.0.0
* Date: 03.04.2008
* Copyright 2008, Jeff Thomas
***************************************************************/

import javax.swing.*;

public class ManipulateQueueDemo
{
	public static void main(String[] args)
	{
		testString();
		System.out.println("");
		testInteger();
	}
	public static void testString()
	{
		ManipulateQueue<String> numbers = new ManipulateQueue<String>();
		numbers.add("eight");
		numbers.add("five");
		numbers.add("two");
		numbers.add("three");
		numbers.add("seven");
		int num = Integer.parseInt(JOptionPane.showInputDialog
                ("Which element would you like to move to the front?"));
		System.out.println("Moving element number " + num + " to the front");
		numbers.nToFront(num);
		System.out.println(numbers.toString());
		System.out.println("Reversing the Queue");
		numbers.reverseUsingNtoFront();
		System.out.println(numbers.toString());
		System.out.println("Reversing the Queue");
		numbers.reverseQueue();
		System.out.println(numbers.toString());
	}
	public static void testInteger()
	{
		ManipulateQueue<Integer> numbers = new ManipulateQueue<Integer>();
		numbers.add(8);
		numbers.add(5);
		numbers.add(2);
		numbers.add(3);
		numbers.add(7);
		int num = Integer.parseInt(JOptionPane.showInputDialog
                ("Which element would you like to move to the front?"));
		System.out.println("Moving element number " + num + " to the front");
		numbers.nToFront(num);
		System.out.println(numbers.toString());
		System.out.println("Reversing the Queue");
		numbers.reverseUsingNtoFront();
		System.out.println(numbers.toString());
		System.out.println("Reversing the Queue");
		numbers.reverseQueue();
		System.out.println(numbers.toString());
	}
}